<?php
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=ReporteSubRubro.xls");

    include_once '../../Model/M_SubRubro.php';

    $subRubro = new M_SubRubro();
    $lista = $subRubro->searchSubRubro_All()
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Mantenimiento Sub Rubro</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        
    </head>
    <body style="width: 100%">
        <div>
         <center><H2>REPORTE DE SUB RUBRO</H2></center>
            <table align="center" border='2' width='70%' style='border-collapse: collapse; font-size:8pt' bordercolor='#000000'>
                <thead>
                    <tr align=center bgcolor='#04B431' style='font-weight: bold; text-transform: uppercase'>
                        <th>NRO.</th>
                        <th align="left">SUB RUBRO</th>
                        <th align="left">RUBRO</th>                       
                    </tr>
                </thead>
                <tbody>
                    <?php
                    if (count($lista) > 0) {
                    for ($i = 0; $i < (count($lista)); $i++) {
                    ?>
                    <tr>
                        <td><?php echo $i + 1 ?></td>
                        <td align="left"><?php echo ($lista[$i]['subrubro']); ?></td>
                        <td align="left"><?php echo ($lista[$i]['rubro']); ?></td>
                    </tr>
                    <?php
                    }
                    }
                    ?>
                </tbody>
            </table>
        </div>
    </body>
</html>